import logging

from pylons import request, response, session, tmpl_context as c, url
from pylons.controllers.util import abort, redirect
from portal import model
from portal.lib.base import BaseController, render

log = logging.getLogger(__name__)

def spectacles():
    q = model.Session.query(model.Spectacle)
    spectacles = q.all()
    
    specs = {}
    for spectacle in spectacles:
        specs[spectacle.id] = spectacle.title 
    return specs


def evenements():
    q = model.Session.query(model.Evenement)
    evenementstab = q.all()
    
    even = {}
    for evenement in evenementstab:
        even[evenement.id] = evenement.name 
    return even

def programmations():
    q = model.Session.query(model.Programmation)
    programmationstab = q.all()
    
    progs = {}
    for programmation in programmationstab:
        even[programmation.id] = programmation.title 
    return progs
